<template lang="pug">
  DataTableBody(
    ref="table-main-body"
    v-bind="$attrs"
    v-on="$listeners")
</template>

<script>
/**
 * @name DataTable 组件
 * @author 陈可嘉 <chenkj@gddxit.com>
 * @description 通过配置资源列表URL、资源列定义直接出表格
 */
import DataTableBody from './Body'

export default {
  name: 'data-table',
  components: {
    DataTableBody
  },
  data () {
    return {
      x: 0,
      y: 0
    }
  },
  computed: {
    countData () {
      return this.tableData
    }
  },
  methods: {
    updatePosition (x, y) {
      this.x = x
      this.y = y
    },
    updateY (y) {
      this.y = y
    }
  }
}
</script>

<style scoped lang="sass">
.table-wrapper
  border: 1px solid #ddd
  position: relative
  overflow: hidden
.table-main
  height: 100%
.table-right
  position: absolute
  overflow: hidden
  right: 0
  top: 0
  height: 100%
  border-left:  1px solid #ddd
  box-shadow: 0 0 5px #888
</style>
